// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   register_ok.java

package hr.engage.interview;

import include.nseer_cookie.counter;
import include.nseer_cookie.exchange;
import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class register_ok extends HttpServlet
{

	ServletContext application;
	HttpSession session;

	public register_ok()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		ServletContext dbApplication = dbSession.getServletContext();
		try
		{
			HttpSession session = request.getSession();
			PrintWriter out = response.getWriter();
			nseer_db_backup1 hr_db = new nseer_db_backup1(dbApplication);
			counter count = new counter(dbApplication);
			if (hr_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String major_first_kind_ID = "";
				String major_first_kind_name = "";
				String major_second_kind_ID = "";
				String major_second_kind_name = "";
				String major_first_kind = request.getParameter("select4");
				for (StringTokenizer tokenTO4 = new StringTokenizer(major_first_kind, "/"); tokenTO4.hasMoreTokens();)
				{
					major_first_kind_ID = tokenTO4.nextToken();
					major_first_kind_name = tokenTO4.nextToken();
				}

				String major_second_kind = request.getParameter("select5");
				for (StringTokenizer tokenTO5 = new StringTokenizer(major_second_kind, "/"); tokenTO5.hasMoreTokens();)
				{
					major_second_kind_ID = tokenTO5.nextToken();
					major_second_kind_name = tokenTO5.nextToken();
				}

				String details_number = request.getParameter("details_number");
				String human_name = request.getParameter("human_name");
				String image_degree = request.getParameter("image_degree");
				String interview_amount = request.getParameter("interview_amount");
				String native_language_degree = request.getParameter("native_language_degree");
				String foreign_language_degree = request.getParameter("foreign_language_degree");
				String response_speed_degree = request.getParameter("response_speed_degree");
				String EQ_degree = request.getParameter("EQ_degree");
				String IQ_degree = request.getParameter("IQ_degree");
				String multi_quality_degree = request.getParameter("multi_quality_degree");
				String register = request.getParameter("register");
				String register_time = request.getParameter("register_time");
				String bodyc = new String(request.getParameter("remark").getBytes("UTF-8"), "UTF-8");
				String remark = exchange.toHtml(bodyc);
				try
				{
					String sql = (new StringBuilder("insert into hr_interview(details_number,human_name,human_major_first_kind_ID,human_major_first_kind_name,human_major_second_kind_ID,human_major_second_kind_name,image_degree,native_language_degree,foreign_language_degree,response_speed_degree,EQ_degree,IQ_degree,multi_quality_degree,register,register_time,interview_amount,remark) values ('")).append(details_number).append("','").append(human_name).append("','").append(major_first_kind_ID).append("','").append(major_first_kind_name).append("','").append(major_second_kind_ID).append("','").append(major_second_kind_name).append("','").append(image_degree).append("','").append(native_language_degree).append("','").append(foreign_language_degree).append("','").append(response_speed_degree).append("','").append(EQ_degree).append("','").append(IQ_degree).append("','").append(multi_quality_degree).append("','").append(register).append("','").append(register_time).append("','").append(interview_amount).append("','").append(remark).append("')").toString();
					hr_db.executeUpdate(sql);
					hr_db.commit();
					hr_db.close();
					response.sendRedirect("hr/engage/interview/register_ok_a.jsp");
				}
				catch (Exception ex)
				{
					out.println((new StringBuilder("error")).append(ex).toString());
				}
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception exception) { }
	}
}
